import {
	defineConfig,loadEnv
} from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import vue from '@vitejs/plugin-vue'
import {resolve} from 'path'
import globalStyle from '@originjs/vite-plugin-global-style'
const path = require('path')

export default defineConfig(({ command, mode}) => {
    const env = loadEnv(mode, process.cwd())
	return {
		plugins: [
			uni()
		],
		css: {
			preprocessorOptions: {
				less: {
					additionalData: '@import "./src/static/style/common.less";'
				}
			}
		},
        resolve: {
            alias: {
                '@': resolve(__dirname, 'src')
            }
        },


		// server: {
		// 	port: 3001,
		// 	proxy: {
		// 	  '/huatai': {
		// 		target: 'http://1.207.122.241:9003/',
		// 		changeOrigin: true,
		// 		secure: true,
		// 		rewrite: path => {
		//             return path.replace(/^\/huatai/, '')
		//         }
		// 	  }
		// 	},
		// }
	}
})
